<template>
  <router-view v-slot="{ Component }">
    <KeepAlive v-if="multiPage" :include="cachedViews">
      <component v-if="reloadFlag" :key="key" :is="Component"/>
    </KeepAlive>
    <component v-else-if="reloadFlag" :key="key" :is="Component"/>
  </router-view>
</template>
<script setup>
import {computed} from 'vue';
import store from '@/store';
import {useRoute} from 'vue-router';

defineOptions({name: 'HomeRouterView'});
const cachedViews = computed(() => store.getters.cachedViews);
const multiPage = computed(() => store.getters.multiPage);
const reloadFlag = computed(() => store.getters.reloadFlag);
const route = useRoute();
const key = computed(() => route.fullPath)
</script>
<style scoped lang="scss">

</style>